<?php
/**
 * Created by PhpStorm.
 * User: changyifan
 * Date: 2018/3/2
 * Time: 下午4:46
 */

namespace Home\Model;
use Think\Model\BaseModel;

class BbsRuleModel extends BaseModel{
    protected $_scope = array(
        'default' => array(
            'where' => array('tc_id' => ''),
            'field' => array('tc_id','score_boundary','score_bbs'),
        ),
    );
    protected $_map = array(
        'score_practice' => 'score_bbs',
    );
    public function getBbsRuleInfoListWithTcId($tc_id){

        if ($tc_id == 0){
            $tc_id = array('like','%%');
        }
        $result = $this-> scope('default',array('where'=>array('tc_id'=>$tc_id))) -> select();
        if($result){
            return $result;
        }else{
            return array();
        }
    }
}